<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:switch = "${username!=null}" >
    <a th:case="true" th:text = "${username}" ></a>
    <a th:case="false" href="/login">登录</a>
</div>
<script>

</script>
</body>
</html>